import axios from '@/libs/request'

/**
 * 获取列表
 * @param data
 * @returns {*}
 */
export const findArticleList = (data, php) => {
  let url = '/api/as/ctcm/permit/findPermitList'
  if (php === true) {
    url = '/wl/api/customerSearchUser'
  }
  return axios.request({
    url: url,
    data: data,
    type: 'post'
  })
}
// 删除代办信息
export const deleteDelAgency = (data) => {
  return axios.request({
    url: 'wl/api/deleteDelAgency',
    data: data,
    type: 'post',
    php: true
  })
}
// 查询心理咨询
export const searchConsultation = (data) => {
  return axios.request({
    url: 'wl/searchConsultation',
    data: data,
    type: 'post'
  })
}
export const updatePermitInfo = (data) => {
  return axios.request({
    // url: '/api/ac/ctcm/updatePermitInfoService/updatePermitInfo'
    url: '/wl/api/updateTongXingZhengInfo',
    data: data,
    type: 'post',
    php: true,
    await: true
  })
}
export const useOpenidDelRedis = (data) => {
  return axios.request({
    // url: '/api/ac/ctcm/updatePermitInfoService/updatePermitInfo'
    url: 'wl/useOpenidDelRedis',
    data: data,
    type: 'post',
    php: true
  })
}
// 删除redis值，删除唯一
export const delUniIdcardRedis = (data) => {
  return axios.request({
    // url: '/api/ac/ctcm/updatePermitInfoService/updatePermitInfo'
    url: '/wl/delUniIdcardRedis',
    data: data,
    type: 'get',
    php: true
  })
}
export const peopleTrackList = (data) => {
  return axios.request({
    url: '/wl/api/peopleTrackList',
    data: data,
    type: 'post',
    php: true
  })
}
export const selectCoupon = (data) => {
  return axios.request({
    url: 'wl/selectCoupon',
    data: data,
    type: 'post',
    php: true
  })
}
export const selectBooksCoupon = (data) => {
  return axios.request({
    url: 'wl/selectBooksCoupon',
    data: data,
    type: 'post',
    php: true
  })
}
export const selectRedisInfo = (data) => {
  return axios.request({
    url: 'wl/selectRedisInfo',
    data: data,
    type: 'post',
    php: true
  })
}

/***
 * 特殊人群
 */

// 列表
export const findReviseList = (data) => {
  return axios.request({
    url: '/api/as/ctcm/revisedao/findReviseList',
    data: data,
    type: 'post'
  })
}

// 修改
export const saveRevise = (data) => {
  return axios.request({
    url: '/api/as/ctcm/revisedao/saveRevise',
    data: data,
    type: 'post'
  })
}

// 删除
export const updateReviseState = (data) => {
  return axios.request({
    url: '/api/as/ctcm/revisedao/updateReviseState',
    data: data,
    type: 'post'
  })
}

/***
 * 白名单(红黄绿)
 */

// 列表
export const getWhiteList = (data) => {
  return axios.request({
    url: '/api/as/ctcm/whitelistdao/getWhiteList',
    data: data,
    type: 'post'
  })
}

// 修改/删除
export const saveWhiteList = (data) => {
  return axios.request({
    url: '/api/as/ctcm/whitelistdao/saveWhiteList',
    data: data,
    type: 'post'
  })
}

/***
 * 白名单(外籍)
 */

// 列表
export const getWhiteForeignList = (data) => {
  return axios.request({
    url: '/api/as/ctcm/whitelistdao/getWhiteForeignList',
    data: data,
    type: 'post'
  })
}

// 修改/删除
export const saveWhiteForeignList = (data) => {
  return axios.request({
    url: '/api/as/ctcm/whitelistdao/saveWhiteForeignList',
    data: data,
    type: 'post'
  })
}
// 查询公安扫码人员
export const getUserPermitList = (data) => {
  return axios.request({
    url: '/api/ac/ctcm/userPermitGaService/getUserPermitList',
    data: data,
    type: 'post'
  })
}
// 查询机构列表
export const getPlaceMapList = (data) => {
  return axios.request({
    url: '/api/as/ctcm/place/getPlaceMapList',
    data: data,
    type: 'post'
  })
}
